var mDefaultServerAddr;
var APPID; // 集群应用appid
var mDefaultServerPort;// 默认服务器端口号
(function(){
	var AnyChatFaceX = {};

	AnyChatFaceX.resource_ip = ' http://120.76.248.33'; //获取资源ip http://120.76.248.33 , http://fxclient.anychat.cn
	AnyChatFaceX.ppt_audio_ip = 'http://120.76.248.33';  //ppt ip  http://120.76.248.33   ; http://120.77.67.166

	mDefaultServerAddr = "120.76.248.33";		// 默认服务器地址demo.anychat.cn 120.77.67.166  120.76.248.33
	APPID = '7A234B54-C9A4-F749-B302-DA8DB7C0D882'; // 集群应用appid
	mDefaultServerPort = 8906;					// 默认服务器端口号


	AnyChatFaceX.origin = "";
	AnyChatFaceX.agentid = '';//坐席id
	AnyChatFaceX.ServiceUrl = function (pathname){
		return AnyChatFaceX.origin + pathname;
	};
	AnyChatFaceX.token="";

	AnyChatFaceX.imgArr = [];

	AnyChatFaceX.initAjaxHeader = function(token,agentid){
		this.agentid = agentid;
		$.ajaxSetup({
			headers: { // 默认添加请求头
				"token": token,
				'agentid':agentid
			}
		});
	};
	//字符串长度限制;
	AnyChatFaceX.cutstr=function(str,len){
		var str;
		var str_length = 0;
		var str_len = 0;
		str_cut = new String();
		str_len = str.length;
		for (var i = 0; i < str_len; i++) {
			var a = str.charAt(i);
			str_length++;
			if (escape(a).length > 4) {
				//中文字符的长度经编码之后大于4
				str_length++;
			}
			str_cut = str_cut.concat(a);
			if (str_length >= len) {
				str_cut = str_cut.concat("..");
				return str_cut;
			}
		}
		//如果给定字符串小于指定长度，则返回源字符串；
		if (str_length < len) {
			return str;
		}
	};

	/**
	 * 退出房间
	 * @constructor
	 */
	AnyChatFaceX.exitRoom=function(){

	};

	/**
	 * 进入房间
	 * @type {{}}
	 */
	AnyChatFaceX.enterRoom=function(){
		$('#AnyChatRemoteVideoDiv').css('visibility','visible');
	};


	/**客户信息
	 *
	 *@constructor
	 */
	AnyChatFaceX.ClientInfo= {};

	/**
	 * 选择产品
	 * @type {{}}
	 */
	AnyChatFaceX.ProductInfo= {};


	AnyChatFaceX.getProductInfo=function (){
		var arr = AnyChatFaceX.ProductInfo;
		for(var i in arr){
			if(arr[i].id==AnyChatFaceX.business_id){
				var prodcut = arr[i].productset;
				for(var k in prodcut){
					if(prodcut[k].id==AnyChatFaceX.product_id){
						return prodcut[k];
					}
				}
			}
		}
	};


	/**
	 * 上传视频文件数组
	 * @type {Array}
	 */
	AnyChatFaceX.uploadVideoArr = [];

	/**
	 * 上传录像文件  _01
	 */
	AnyChatFaceX.uploadVideo01 = function (filehashcode,videourl){

	};


	/**
	 * 上传录像文件  _02
	 */
	AnyChatFaceX.uploadVideo02 = function (videourl,videolen,validity,filehashcode,task_id){

	};


	/**
	 * 根据流水号获取业务信息
	 * @param tradeon
	 */
	AnyChatFaceX.getTradeByTradeOn = function(tradeon){

	};

	/**
	 * 取消业务接口
	 */
	AnyChatFaceX.cancelTrade = function(){

	};


	/**
	 * 绑定经办人的关系
	 */
	AnyChatFaceX.bindAgent = function(){

	};


	/**
	 * 提交业务
	 */
	AnyChatFaceX.submitted=function(){


	};

	//AnyChatFaceX.userInfo = JSON.parse(localStorage.getItem("userInfo")) || {};
	window.AnyChatFaceX = window.AnyChatFaceX || AnyChatFaceX;
})();





